<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>iframe</title>
</head>
<body>
	<p>父子关系域，通过修改document.domain可以实现访问</p>
	<p>页面url http://www.example.com/js/document_domain/domain2.html</p>
	<iframe id="iframe" src="http://example.com/js/document_domain/domain2.html" onload="test()"></iframe>
	<p>this is a</p>
	<script type="text/javascript">
		function test() {
			document.domain = "example.com";
			var iframe = document.getElementById("iframe");
			var win = iframe.contentWindow;
			var doc = win.document;
			var name = win.name;
		}
	</script>
</body>
</html>